<template>
  <div>
    <div class="flex justify-end">
      <el-button type="primary" @click="goDetail('add')"> 添加 </el-button>
    </div>
    <div>
      <el-card style="max-width: 280px" shadow="hover">
        <template #header>
          <div class="text-center">优鲜</div>
        </template>
        <ul>
          <li><span class="pr-[10px]">简介: </span>核心客户端项目</li>
          <li><span class="pr-[10px]">平台: </span>app，小程序</li>
        </ul>
        <template #footer>
          <div class="flex justify-around">
            <el-button type="primary" @click="goDetail('view')"> 查看 </el-button>
            <el-button type="primary" @click="goDetail('edit')"> 修改 </el-button>
            <el-button type="danger" @click="deleteHandler('delete')"> 删除 </el-button>
          </div>
        </template>
      </el-card>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { useRouter } from "vue-router";
const router = useRouter();
function goDetail(type: "add" | "edit" | "view") {
  console.log("添加");
  router.push({
    path: "/projectManage/detail",
    query: {
      type
    }
  });
}

function deleteHandler() {
  console.log("删除");
}
</script>
